<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<h:form>
		<h:panelGroup rendered="#{!authenticator.authenticated}">

			<p:growl id="growl" life="2000" showDetail="false" />
			<h:panelGrid columns="5" styleClass="grpLogin">

				<h:outputLabel for="username" styleClass="edtLogin">Usuário:</h:outputLabel>
				<h:inputText id="username" required="true" styleClass="edtLogin"
					value="#{authenticator.username}"
					requiredMessage="Usuário é obrigatório!" />

				<h:outputLabel for="password" styleClass="edtLogin">Senha:</h:outputLabel>
				<h:inputSecret id="password" required="true" styleClass="edtLogin"
					value="#{authenticator.password}"
					requiredMessage="Senha é obrigatório!" />

				<p:commandButton value="Ok" styleClass="btnLogin"
					action="#{authenticator.login}" ajax="false" />

			</h:panelGrid>

		</h:panelGroup>
		<h:panelGroup rendered="#{authenticator.authenticated}">
			<h:panelGrid columns="2" styleClass="grpLogin">
				<h:outputText value="#{authenticator.principal}" />
				<p:commandLink action="#{authenticator.preLogout}" value="Sair"
					ajax="false" />
			</h:panelGrid>
		</h:panelGroup>
	</h:form>
</ui:composition>
